home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.paused)
- {
- return undefined;
- }
- if(timeB)
- {
- time++;
- if(time > 3)
- {
- var b = type + _root.depthHolder;
- _root.depthHolder = _root.depthHolder + 1;
- _root.attachMovie(type,b,random(100000));
- _root[b]._x = _X;
- _root[b]._y = _Y + 50;
- if(c == 1)
- {
- _root[b].type = "slow";
- }
- if(c == 2)
- {
- _root[b].type = "homing";
- }
- time = 0;
- bombs++;
- }
- if(c == 1)
- {
- m = 10;
- }
- if(c == 2)
- {
- m = 15;
- }
- if(bombs > m)
- {
- bombs = 0;
- timeB = false;
- changeDir();
- time = 0;
- }
- }
- if(getTimer() > resetTime)
- {
- changeDir();
- resetTime = getTimer() + delay;
- }
- if(dir == "left")
- {
- _X = _X - speed;
- }
- if(dir == "right")
- {
- _X = _X + speed;
- }
- if(_X > 500)
- {
- dir = "left";
- }
- if(_X < 100)
- {
- dir = "right";
- }
- time++;
- if(time > 200)
- {
- bomb();
- time = 0;
- }
- if(!damage)
- {
- if(this.box.hitTest(_root.car))
- {
- _root.cSound();
- damage = true;
- health -= 20;
- _root.car.ySpeed = (- _root.car.ySpeed) * 0.3;
- _root.gravity("reverse");
- }
- }
- if(damage)
- {
- _alpha = random(100) + 10;
- t++;
- if(t > 20)
- {
- t = 0;
- _alpha = 100;
- damage = false;
- }
- }
- if(_root.car.dead)
- {
- ufoS.stop();
- }
- }
-